home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "qfaxdrv.h"
-
-
- int convert(char *filename)
- {
- FILE *F;
- char *faxtype="ascii";
- int line=0;
-
-
- printf("reading '%s'\n",filename);
-
- F=fopen(filename,"r");
- if(F)
- {
- char str[CHAR_PER_LINE+1];
-
-
- while(fgets(str,CHAR_PER_LINE,F))
- {
- if(!line)
- {
- if(qfax_open(faxtype)) /* neue faxseite oeffnen */
- return(-2);
-
- printf("writing '%s'\n",filename);
- qfax_text("");
- }
-
- qfax_text(str); /* eine textzeile nach fax */
- putchar('.');
-
- if(++line==LINES_PER_PAGE-2) /* seitenende */
- {
- printf("\n");
- qfax_text("");
- qfax_close();
- line=0;
- }
- }
-
- if(line)
- qfax_close(); /* letzte faxseite schliessen */
-
- fclose(F);
- return(0);
- }
-
- return(-1);
- }
-
- extern int verbosedriver;
-
- int main(int argc, char *argv[])
- {
- if(qfax_init()) /* treiber initialisieren */
- return(-1);
-
- verbosedriver=0; /* global flag ausschalten */
- while(--argc)
- if(convert(*++argv))
- break;
-
- return(0);
- }
-